﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="Common/layim/layui_exts/formSelects-v4.css" rel="stylesheet" />
</head>

<body>


    //1.下载formSelects-v4

    //然后引入formSelects.css
    <script src="Common/layim/dist/layui.all.js"></script>
    <button id="so">ddd</button>
    //2.模块化使用

    <script type="text/javascript">
        //全局定义一次, 加载formSelects
        layui.config({
            base: '/Common/layim/layui_exts/' //此处路径请自行处理, 可以使用绝对路径
        }).use(['jquery', 'PDFObject', 'formSelects'], function () {

            var formSelects = layui.formSelects, PDFObject = layui.PDFObject;

            $ = layui.jquery, layer = layui.layer;
            $.ajaxSetup({
                headers: { "Authorization": "bearer " + window.sessionStorage["_token"] }
            });
            console.log(11);
            layer.open({
                type: 1,
                skin: 'layui-layer-rim', //加上边框
                area: ['90%', '90%'], //宽高
                content: '<div id="example" style="height:500px;width:auto"></div>',
                success: function (layero, index) {
                    var options = {
                        height: '100%',
                        pdfOpenParams: { view: 'FitV', page: '2' },
                    };
                    PDFObject.embed("渝黔工〔2018〕53 号关于重新印发《铁路建设项目变更设计管理办法实施细则》的通知(1).pdf", '#example', options);     // 指定配置对象
                    // PDFObject.embed("渝黔工〔2018〕53 号关于重新印发《铁路建设项目变更设计管理办法实施细则》的通知(1).pdf", "#example");
                }
            });

            $.get('/api/Users/GetUsersTreeAsync', { page: 1, limit: 200 }, function (data) {
                mydata = JSON.parse(data);
                console.log(mydata);
                var oslits = new Array();

                $.each(mydata.data, function (index, item) {
                    var os = new Object();
                    os.name = item.name;
                    os.value = item.id;
                    os.children = item.children;
                    oslits.push(os);
                });
                formSelects.data('example6_4', 'local', {
                    arr: oslits
                });

            })
            $("#so").click(function () {
                var kk = formSelects.value('example6_4', 'val');
                console.log(kk);
            })


        });
    </script>

    <div class="layui-form">
        <select name="city" xm-select="example6_4">
            <option value="">此树是我栽</option>
        </select>

    </div>
    <div>
        <div id="example1"></div>
    </div>
    <textarea id="uploadEditor" ></textarea>
    <script src="/Common/ueditor/ueditor.config.js"></script>
    <script src="/Common/ueditor/ueditor.all.js"></script>
    <!--<script src="/Common/ueditor/ueditor.all.min.js"></script>-->
    <script src="/Common/ueditor/ueditor.all.js"></script>
    <script src="/Common/ueditor/lang/zh-cn/zh-cn.js"></script>
    <script src="/Common/layim/dist/layui.all.js"></script>
    <script>
                var ue = UE.getEditor('uploadEditor', {
            initialFrameHeight: 500
        });
    </script>
</body>
</html>